$('button#btn_camera').on('click', function () {
    $.ajax({
        type: 'GET',
        url: '/hand_detect/start',
        dataType: 'json',
        data: {
        },

        success: function (data) {
            if (data["code"] != 200) {
                alert(data["error"]);
            }
        },
        error: function (xhr, ajaxOptions, thrownError) {
            alert(thrownError);
        }
    });
});

$('button#virtual_mouse').on('click', function () {
    $.ajax({
        type: 'GET',
        url: '/hand_detect/virtual_mouse',
        dataType: 'json',
        data: {
        },

        success: function (data) {
            if (data["code"] != 200) {
                alert(data["error"]);
            }
        },
        error: function (xhr, ajaxOptions, thrownError) {
            alert(thrownError);
        }
    });
});

$('button#virtual_painter').on('click', function () {
    $.ajax({
        type: 'GET',
        url: '/hand_detect/virtual_painter',
        dataType: 'json',
        data: {
        },

        success: function (data) {
            if (data["code"] != 200) {
                alert(data["error"]);
            }
        },
        error: function (xhr, ajaxOptions, thrownError) {
            alert(thrownError);
        }
    });
});

$('button#volumn_control').on('click', function () {
    $.ajax({
        type: 'GET',
        url: '/hand_detect/volumn_control',
        dataType: 'json',
        data: {
        },

        success: function (data) {
            if (data["code"] != 200) {
                alert(data["error"]);
            }
        },
        error: function (xhr, ajaxOptions, thrownError) {
            alert(thrownError);
        }
    });
});
